<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户登录</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }

        .container {
            background-color: white;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            width: 300px;
        }

        h2 {
            text-align: center;
            color: #333;
        }

        .form-group {
            margin-bottom: 15px;
        }

        label {
            display: block;
            margin-bottom: 5px;
            color: #333;
        }

        input[type="text"], input[type="password"] {
            width: 90%;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
        }

        button {
            width: 100%;
            padding: 10px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
        }

        button:hover {
            background-color: #0056b3;
        }

        .switch-form {
            text-align: center;
            margin-top: 15px;
        }

        .switch-form a {
            color: #007bff;
            text-decoration: none;
        }

        .switch-form a:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
<div class="container">
    <div id="loginForm">
        <h2>用户登录</h2>
        <form action="/schedule_system_war/user/login" method="post">
            <div class="form-group">
                <label for="loginUsername">用户名:</label>
                <input type="text" id="loginUsername" name="username" required>
                <div id="UsernameMsg"></div>
            </div>

            <div class="form-group">
                <label for="loginPassword">密码:</label>
                <input type="password" id="loginPassword" name="password" required>
<!--                <img src="项目/JS案例需要的素材/小眼睛.png" alt="">-->
            </div>
            <div id="UserPasswordMsg"></div>
            <button type="submit">登录</button>
        </form>
        <div class="switch-form">
            没有账户? <a href="register.html">立即注册</a>
        </div>
    </div>
</div>

<script>
    // //获取用户名和信息
    // var userName = document.querySelector("#loginUsername");
    // var userNameMsg = document.querySelector("#UsernameMsg");
    //
    // function checkUserName() {
    //     if (/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(userName.value)) {
    //         userNameMsg.innerHTML = "<span style='color: green'>正确</span>"
    //     } else {
    //         userNameMsg.innerHTML = "<span style='color: red'>错误，请重新输入</span>"
    //     }
    // }
    //
    // //失去焦点触发
    // userName.addEventListener("blur", checkUserName)
    //
    //
    // var password = document.querySelector("#loginPassword");
    // var passwordMsg = document.querySelector("#UserPasswordMsg");
    //
    // function checkUserPassword() {
    //     if (/^\S*(?=\S{6,})(?=\S*\d)(?=\S*[A-Z])(?=\S*[a-z])(?=\S*[!@#$%^&*? ])\S*$/.test(password.value)) {
    //         passwordMsg.innerHTML = "<span style='color: green'>正确</span>"
    //     } else {
    //         passwordMsg.innerHTML = "<span style='color: red'>" +
    //             "✅ 至少6个字符长度<br>" +
    //             "✅ 包含至少一个数字 (0-9)<br>" +
    //             "✅ 包含至少一个大写字母 (A-Z)<br>" +
    //             "✅ 包含至少一个小写字母 (a-z)<br>" +
    //             "✅ 包含至少一个特殊字符 (!@#$%^&*? 或空格)<br>" +
    //             "✅ 不能包含空白字符</span>"
    //     }
    // }

/*    //失去焦点触发
    password.addEventListener("blur", checkUserPassword)
    let flag = false;

    const svgImageElement = document.querySelector("img");
    svgImageElement.addEventListener("click", function () {
        password.setAttribute("type", "text");
    });*/
/*
    if (flag) {
        svgImageElement.addEventListener("click", function () {

            password.setAttribute("text", "type");
        })
    }*/

</script>
</body>
</html>
